<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/jquery.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        #img {
            position: absolute;
        }
    </style>
</head>

<body>
    <img src="imges/bilibili.png" alt="" id="img">
    <script>
        $(function () {
            var img = $('#img');
            var timer = null;
            //节流阀
            $(document).on('mousemove', function (e) {
                if (timer != null) { return }
                timer = setTimeout(function () {//开启延时器
                    $(img).css('left', e.pageX + 'px').css('top', e.pageY + 'px');
                    console.log('ok');
                    timer = null;
                }, 16);
            });
        });
    </script>
</body>

</html>